/*
 * Copyright (c) 2023 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "disable_activation_lock_plugin.h"

#include "netsys_controller.h"
#include "system_ability_definition.h"

#include "edm_constants.h"
#include "edm_ipc_interface_code.h"
#include "edm_sys_manager.h"
#include "map_string_serializer.h"
#include "iplugin_manager.h"
#include "ipolicy_manager.h"

namespace OHOS {
namespace EDM {
const bool REGISTER_RESULT = IPluginManager::GetInstance()->AddPlugin(DisabledActivationLockPlugin::GetPlugin());

void DisabledActivationLockPlugin::InitPlugin(
    std::shared_ptr<IPluginTemplate<DisabledActivationLockPlugin, std::map<std::string, std::string>>> ptr)
{
    EDMLOGI("DisabledActivationLockPlugin InitPlugin...");
    ptr->InitAttribute(EdmInterfaceCode::DIDABLED_ACTIVATION_LOCK, PolicyName::POLICY_DISABLED_ACTIVATION_LOCK,
        true);
    ptr->SetSerializer(MapStringSerializer::GetInstance());
    ptr->SetOnHandlePolicyListener(&DisabledActivationLockPlugin::OnSetPolicy, FuncOperateType::SET);
    ptr->SetOnAdminRemoveListener(&DisabledActivationLockPlugin::OnAdminRemove);
}

ErrCode DisabledActivationLockPlugin::OnGetPolicy(std::string &policyData, MessageParcel &data, MessageParcel &reply,
    int32_t userId)
{
    EDMLOGD("DisabledNetworkInterfacePlugin OnGetPolicy.");
    
}

ErrCode DisabledActivationLockPlugin::OnSetPolicy(std::map<std::string, std::string> &data,
    std::map<std::string, std::string> &currentData, std::map<std::string, std::string> &mergeData, int32_t userId)
{
    EDMLOGD("DisabledNetworkInterfacePlugin OnSetPolicy.");

}



ErrCode DisabledActivationLockPlugin::OnAdminRemove(const std::string &adminName,
    std::map<std::string, std::string> &data, std::map<std::string, std::string> &mergeData, int32_t userId)
{
    
}

} // namespace EDM
} // namespace OHOS